{smcl}
{txt}{sf}{ul off}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}E:\Github\Bolivia\00_replication_files\log-files/2_Figure_A2.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}25 Jan 2022, 21:39:59
{txt}
{com}. 
. timer on 2
{txt}
{com}. 
. *------------*
. * Figure A.2 *
. *------------*
.         * Figure A.2.a
.         *-------------
.                 use "data/outputs/computo_verificadortrepdate_nomissings.dta", clear
{txt}
{com}.                 keep NumMesa trep_date
{txt}
{com}. 
.                 merge 1:1 NumMesa using "data/outputs/computo_ulttranstrepdate_nomissings.dta", ///
>                         keepusing(trep_date_ulttrans)
{res}
{txt}{col 5}Result{col 38}# of obs.
{col 5}{hline 41}
{col 5}not matched{col 30}{res}           1,134
{txt}{col 9}from master{col 30}{res}               0{txt}  (_merge==1)
{col 9}from using{col 30}{res}           1,134{txt}  (_merge==2)

{col 5}matched{col 30}{res}          33,044{txt}  (_merge==3)
{col 5}{hline 41}

{com}.                 drop _merge
{txt}
{com}. 
.                 local x = tc(20oct2019 19:40:57)
{txt}
{com}.                 local x2 = tc(20oct2019 20:06:59)
{txt}
{com}.                 local y = tc(21oct2019 14:56:00)
{txt}
{com}.                 local ymin = tc(20oct2019 05:21:28)
{txt}
{com}.                 local ywebsite = tc(21oct2019 18:29:53)
{txt}
{com}.                 local ymax = tc(21oct2019 21:44:53)
{txt}
{com}. 
.                 local xtick0 = tc(20oct2019 8:00:00)
{txt}
{com}.                 local xtick1 = tc(20oct2019 16:00:00)
{txt}
{com}.                 local xtick2 = tc(20oct2019 23:59:00)
{txt}
{com}.                 local xtick3 = tc(21oct2019 8:00:00)
{txt}
{com}. 
.                 local oct22nd = tc(22oct2019 00:00:01)
{txt}
{com}.                 
.                 drop if trep_date_verificador >= `oct22nd' & trep_date_verificador != .
{txt}(1 observation deleted)

{com}.                 drop if trep_date_ulttrans >= `oct22nd' & trep_date_ulttrans != .
{txt}(8 observations deleted)

{com}. 
.                 twoway (scatter trep_date_verificador trep_date_ulttrans if ///
>                                         trep_date_ulttrans < `ywebsite', ///
>                                         msize(vtiny) mcolor(midblue)) ///
>                         (line trep_date_ulttrans trep_date_ulttrans if ///
>                                 trep_date_ulttrans < `ywebsite', lcolor(gs6)), ///
>                                 graphregion(color(white)) ///
>                         aspectratio(1) ///
>                         text(`x2' `=`xtick0'+4000000' "8:06:59 p.m.", fcolor(white) box bcolor(white)) ///
>                         text(`y' `=`xtick0'+10000' "2:56 p.m.", fcolor(white) box bcolor(white)) ///
>                         yline(`x2', lcolor(black) lpattern(dash)) ///
>                         xlabel(`xtick0' `" "10/20" "8:00 a.m." "' ///
>                                    `xtick1' `" "10/20" "4:00 p.m." "' ///
>                                    `xtick2' `" "10/21" "12:00 a.m." "' /// 
>                                    `xtick3' `" "10/21" "8:00 a.m." "', labsize(small) ) /// 
>                         ylabel(`x2' "10/20" ///
>                                    `y'  "10/21", angle(0) nogrid) ///
>                         ytitle("Verification Time") ///
>                         xtitle("Transmission Time") ///
>                         xsize(5) ysize(5) ///
>                         yscale(range(`ymin' `ywebsite' )) ///
>                         legend(symxsize(*.25) lab(2 "45°")  pos(5) ring(0) order(2)) 
{res}{txt}
{com}.                 graph export "outputs/generated/Figure_A2a.png", replace
{txt}(note: file outputs/generated/Figure_A2a.png not found)
(file outputs/generated/Figure_A2a.png written in PNG format)

{com}. 
.         * Figure A.2.b
.         *-------------
.                 use "data/outputs/computo_ulttranstrepdate_nomissings.dta", clear
{txt}
{com}. 
.                 keep NumMesa trep_date_ulttrans pcs_so
{txt}
{com}.                 rename trep_date_ulttrans trep_date_ult_trans_date
{res}{txt}
{com}.                 rename pcs_so pcs_so_ult_trans_date
{res}{txt}
{com}. 
.                 tempfile ult
{txt}
{com}.                 save `ult'
{txt}file C:\Users\Nicolas\AppData\Local\Temp\ST_2420_000001.tmp saved

{com}. 
.                 * Use data set with problem booths appended at the end
.                 use "data/outputs/computo_verificadortrepdate_nomissings.dta", clear
{txt}
{com}.                 keep NumMesa trep_date_verificador pcs_so trep_missing_date
{txt}
{com}. 
.                 merge 1:1 NumMesa using `ult'
{res}
{txt}{col 5}Result{col 38}# of obs.
{col 5}{hline 41}
{col 5}not matched{col 30}{res}           1,134
{txt}{col 9}from master{col 30}{res}               0{txt}  (_merge==1)
{col 9}from using{col 30}{res}           1,134{txt}  (_merge==2)

{col 5}matched{col 30}{res}          33,044{txt}  (_merge==3)
{col 5}{hline 41}

{com}.                 drop _merge
{txt}
{com}.                 sort trep_date_verificador
{txt}
{com}. 
.                 keep NumMesa trep_date_verificador trep_date_ult_trans_date
{txt}
{com}. 
.                 gen t = 1
{txt}
{com}.                 bys t (trep_date_verificador): gen cdf_verificador = _n if trep_date_verificador != .
{txt}(1,134 missing values generated)

{com}.                 count if trep_date_verificador != .
  {res}33,044
{txt}
{com}.                 local N = r(N)
{txt}
{com}.                 replace cdf_verificador = cdf_verificador / `N'
{txt}(33,044 real changes made)

{com}. 
.                 bys t (trep_date_ult_trans_date): gen cdf_transmision = _n if trep_date_ult_trans_date != .
{txt}
{com}.                 count if trep_date_ult_trans_date != .
  {res}34,178
{txt}
{com}.                 local N = r(N)
{txt}
{com}.                 replace cdf_transmision = cdf_transmision / `N'
{txt}(34,178 real changes made)

{com}. 
.                 gen t2=_n
{txt}
{com}.                 gen dif = abs(trep_date_verificador - tc(20oct2019 20:06:59))
{txt}(1,134 missing values generated)

{com}.                 sort dif
{txt}
{com}.                 sum cdf_verificador if _n==1

{txt}    Variable {c |}        Obs        Mean    Std. Dev.       Min        Max
{hline 13}{c +}{hline 57}
cdf_verifi~r {c |}{res}          1    .9552112           .   .9552112   .9552112
{txt}
{com}.                 local cutoff = `r(mean)'
{txt}
{com}.                 sort t2
{txt}
{com}.                 drop t2 dif
{txt}
{com}. 
.                 twoway (scatter cdf_verificador cdf_transmision, msize(vtiny) mcolor(midblue)), ///
>                         graphregion(color(white)) legend(off) xtitle("Proportion of Tally Sheets Transmitted") ///
>                         ytitle("Proportion of Tally Sheets Verified") aspectratio(1) ///
>                         text(`cutoff' 0.125 "8:06:59 p.m.", fcolor(white) box bcolor(white)) ///
>                         ylabel(0 .2 .4 .6 .8 `cutoff' ".96" 1, angle(0) nogrid) ///
>                         xsize(5) ysize(5) ///
>                         yline(`cutoff', lpattern(dash) lcolor(black)) 
{res}{txt}
{com}.                 graph export "outputs/generated/Figure_A2b.pdf", replace
{txt}(file outputs/generated/Figure_A2b.pdf written in PDF format)

{com}. 
. *------------------------------------------------------------------------------*
. timer off 2
{txt}
{com}. timer list 2
{res}   2:      2.02 /        1 =       2.0170
{txt}
{com}. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}E:\Github\Bolivia\00_replication_files\log-files/2_Figure_A2.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}25 Jan 2022, 21:40:01
{txt}{.-}
{smcl}
{txt}{sf}{ul off}